package ru.urfc.portal.ui.client.renderers;

import java.util.Date;

import ru.urfc.portal.ui.client.Utils;
import ru.urfc.portal.ui.client.descriptor.GridField;

import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.dom.client.Element;

public class DateRenderer extends SimpleRenderer {
	
	public DateRenderer(GridField field, Element element) {
		super(field, element);
	}

	@Override
	public String render(ModelData modelData) {		
		Date value = field.<Date>getValue(modelData);
		return value == null? "": Utils.dateToStr(value);
	}	

}
